/*
* @Description: Matrix-IQ竞赛机器人

* @Author: Yinshen Wang
* @Email: wangyinshen@zju.edu.cn
* @Date:   2024-03-21 01:27:15
*/

#ifndef MatrixIQ_ESP32_h
#define MatrixIQ_ESP32_h


//PWM引脚为ESP32引脚,DIR引脚为MCP23017引脚
#define M1PWM 32
#define M1DIR1 8
#define M1DIR2 9

#define M2PWM 15
#define M2DIR1 10
#define M2DIR2 11

#define M3PWM 33
#define M3DIR1 12
#define M3DIR2 13

#define M4PWM 27
#define M4DIR1 14
#define M4DIR2 15


#include <Wire.h>
#include "Adafruit_MCP23017.h"

class MatrixIQ_ESP32 : public Adafruit_MCP23017
{
	public:
		MatrixIQ_ESP32(uint8_t mcp_Addr);
		void motorRun(uint8_t No, int speed, int direction);
		void motorRun(uint8_t No, int speed);
		void motorStop(uint8_t No);
		void init();
};

#endif